package Day6;

import java.util.Stack;
import java.util.Scanner;

public class Main {

    public static void main2(String[] args) {
        System.out.println(new Main().StrToInt("-432895792"));
        System.out.println(new Main().StrToInt("jfsk222"));
        System.out.println(new Main().StrToInt("+1230981279"));
        System.out.println(new Main().StrToInt("2147483647"));
    }

    public int StrToInt(String str) {
        char[] chars = str.toCharArray();
        if (chars.length == 0) {
            return 0;
        }

        //记录是否有符号,默认没有false
        boolean plusOrMinus = false;

        //第一位是 + -
        if (chars[0] == '+' || chars[0] == '-') {
            plusOrMinus = true;
            for (int i = 1; i < chars.length; i++) {
                //出现数字以外的字符
                if (chars[i] < '0' || chars[i] > '9') {
                    return 0;
                }
            }
        }
        //第一位不是+ -
        else {
            for (char aChar : chars) {
                //出现数字以外的字符
                if (aChar < '0' || aChar > '9') {
                    return 0;
                }
            }
        }



        //有符号
        if (plusOrMinus) {
            if (chars[0] == '+') {
                return switchToInt(str.substring(1));
            } else {
                return -switchToInt(str.substring(1));
            }
        }
        //无符号
        else {
            return switchToInt(str);
        }
    }

    public static int switchToInt (String s) {

        char[] chars = s.toCharArray();
        Stack<Integer> stack = new Stack<>();

        for (char aChar : chars) {
            stack.push(aChar - 48);
        }
        //十进制位
        int d = 1;
        int ret = 0;
        while (!stack.empty()) {
            ret += stack.pop() * d;
            d *= 10;
        }

        return ret;
    }

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextLine()) {
            String s = scanner.nextLine();
            String[] strings = s.split(" ");

            int W = Integer.parseInt(strings[0]);
            int H = Integer.parseInt(strings[1]);

            int ret = 0;
            //i遍历层, j遍历列
            for (int i = 0; i < H; i++) {

                if (i % 4 == 0 || i % 4 == 1) {
                    for (int j = 0; j < W; j++) {
                        if (j % 4 == 0 || j % 4 == 1) {
                            ret++;
                        }
                    }
                } else {
                    for (int j = 0; j < W; j++) {
                        if (j % 4 == 2 || j % 4 == 3) {
                            ret++;
                        }
                    }
                }
            }

            System.out.print(ret);
        }

    }

    public static double getDistance (int x1, int y1, int x2, int y2) {
        return Math.abs (
                Math.sqrt (
                        (x1 - x2) * (x1 - x2)
                                + (y1 - y2) * (y1 - y2)
                ) );
    }

}
